#ifndef HISTOGRAMWIDGET_H
#define HISTOGRAMWIDGET_H

#include <QDockWidget>
#include <QFrame>
#include <QLabel>
#include <QVBoxLayout>
#include <QComboBox>
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QGraphicsPixmapItem>

#include "limage.h"

class HistogramWidget : public QDockWidget
{
Q_OBJECT
public:
    explicit HistogramWidget(QWidget *parent = 0);

    void setHistograms(QImage rgbHisto, QImage yuvHisto);
    void setImage(LImage *image);
    void updateHistograms();
    void clearHistograms();

protected:
    void resizeEvent(QResizeEvent*);

private slots:
    void changeSpace(int);

private:
    QGraphicsView *gView;
    QGraphicsScene *scene;
    QComboBox *spaceCombo;
    QGraphicsPixmapItem *histoItem;
    QImage rgbHisto;
    QImage yuvHisto;
    LImage *image;

    void setHistogram(QImage histo);

};

#endif // HISTOGRAMWIDGET_H
